<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>全局组件案例1</title>
    <script src="../vue.js"></script>
</head>
<body>
    <template id="t1">
        <div style="float: left;">
            <div><img src="../images/model14.jpg" style="width: 240px;height: 144px;"></div>
            <div><span style="font-weight: bold;">{{lessionName}}</span></div>
            <div>{{lessionDesc}}</div>
        </div>
    </template>
    <div id="app1" style="width: 960px;margin: 0 auto;">
       <lession></lession>
       <lession></lession>
       <lession></lession>
       <lession></lession>
       <lession></lession>
       <lession></lession>
       <lession></lession>
    </div>
   
</body>
</html>
<script>
    //定义全局组件
    Vue.component('lession',{
        template:'#t1',
        data:function(){
            return{
                lessionName:'Java学习专题',
                lessionDesc:'Java是当今世界上最主流的编程语言'
            }
        }
    });
    var vm=new Vue({
        el:'#app1'
    });
</script>